import React, { useContext } from 'react'
import { Button } from 'antd'
import ThemeContext from '../../ThemeContext'

function VoteFooter(props) {
  let { store } = useContext(ThemeContext)
  let change = function change(type) {
    store.dispatch({
      type: type === 'sup' ? 'VOTE_SUP' : 'VOTE_OPP',
      step: 1
    })
  }
  return <div>
    <Button type='primary' onClick={change.bind(null, 'sup')}>支持</Button>
    <Button type='primary' danger onClick={change.bind(null, 'opp')}>反对</Button>
  </div>
}

export default VoteFooter